Repository navigation
ref(events): yield only the params to raw CDP event callbacks - #710
Merged
Merged
Conversation
The dispatcher passed each callback its index and the total number of callbacks, leaking subscriber internals into on and breaking lambdas and symbol procs taking one argument. Tracing relied on the index and ignored Tracing.tracingComplete unless its callback came first, so a user subscription added before the first record made it time out.
…removal in 0.22 (#709)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
page.on("Some.cdpEvent") { |params, index, total| }yielded the callback's index among the event's subscribers and their total number. That's dispatcher internals leaking into the public API, and it broke one-argument lambdas and symbol procs:page.on("Runtime.consoleAPICalled", &->(params) { ... })raisedArgumentError, which the dispatcher swallowed, so the callback silently never ran.:request,:authand:dialogalready yield only the object.Change
Concurrency::Dispatchercalls each callback with the payload only, so raw CDP events yield just the params.Tracingwas the only internal user of the index: it ignoredTracing.tracingCompleteunless its callback was the first one registered. A user subscription added before the firstrecordtherefore maderecordtime out. The check is gone;Tracingalready subscribes once per page.Breaking
Raw CDP event callbacks no longer receive
indexandtotal. Listed under Changed in the changelog.Specs
tracing.recordreturns the trace whenTracing.tracingCompletealready has a subscriber.Both fail without the change and pass with it.